package com.example.taluo.service;

import io.netty.channel.Channel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;

/*** @Author supersaiya
 * @Description TODO

 * @Date 2025/2/17 15:06

 * @Version 1.0*/
@Service
public class NettyService {
    @Autowired
    private RoomService roomService;

    public void handleMatch(Channel player1, Channel player2) {
        // 创建房间逻辑
        String roomId = UUID.randomUUID().toString();
        //roomService.createRoom(roomId, Long.parseLong(player1.remoteAddress().toString()));
        player1.writeAndFlush("Room ID: " + roomId);
        player2.writeAndFlush("Room ID: " + roomId);
    }
}